import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import DataDetail from './components/DataDetail';
import {useState} from 'react';

const App = () => {

  const [tablePayload, setTablePayload] = useState({page: 1, size: 15, param: {}});
  const [selectedRowKeys, setSelectedRowKeys] = useState([]);
  const [dataDetail, setDataDetail] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <DataDetail data={{dataDetail, setDataDetail}}/>
      <SearchForm data={{tablePayload, setTablePayload, setSelectedRowKeys}}/>
      <DataTable data={{tablePayload, setTablePayload, selectedRowKeys, setSelectedRowKeys, setDataDetail}}/>
    </div>
  );
};

export default App;
